﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:apexControls="clr-namespace:Apex.Controls"
    xmlns:apexCommands="clr-namespace:Apex.Commands"
    xmlns:apexDesign="clr-namespace:Apex.Design">
    
            <SolidColorBrush x:Key="TabItemCloseButtonNormalBackgroundBrush" Color="#00000000" />
            <SolidColorBrush x:Key="TabItemCloseButtonNormalBorderBrush" Color="#FFFFFFFF" />
            <SolidColorBrush x:Key="TabItemCloseButtonNormalForegroundBrush" Color="#FF8f949b" />

            <SolidColorBrush x:Key="TabItemCloseButtonHoverBackgroundBrush" Color="#FFc13535" />
            <SolidColorBrush x:Key="TabItemCloseButtonHoverForegroundBrush" Color="#FFf9ebeb" />

            <SolidColorBrush x:Key="TabItemCloseButtonPressedBackgroundBrush" Color="#FF431e20" />
            <SolidColorBrush x:Key="TabItemCloseButtonPressedBorderBrush" Color="#FF110033" />
            <SolidColorBrush x:Key="TabItemCloseButtonPressedForegroundBrush" Color="#FFf9ebeb" />
    
    <Style TargetType="apexControls:CrossButton">
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="apexControls:CrossButton">
                     <Grid Background="Transparent">
                        <Ellipse x:Name="backgroundEllipse" Fill="{TemplateBinding NormalBackgroundBrush}" />
                        
                        <Path x:Name="ButtonPath"
                              Margin="3"
                              Stroke="{TemplateBinding NormalCrossBrush}"
                              StrokeThickness="1.5"
                              StrokeStartLineCap="Square"
                              StrokeEndLineCap="Square"
                              Stretch="Uniform"
                              VerticalAlignment="Center"
                              HorizontalAlignment="Center">
                            <Path.Data>
                                <PathGeometry>
                                    <PathGeometry.Figures>
                                        <PathFigure StartPoint="0,0">
                                            <LineSegment Point="25,25"/>
                                        </PathFigure>
                                        <PathFigure StartPoint="0,25">
                                            <LineSegment Point="25,0"/>
                                        </PathFigure>
                                    </PathGeometry.Figures>
                                </PathGeometry>
                            </Path.Data>
                        </Path>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames  
                                            AutoReverse="False" Duration="00:00:00.2"
                                            Storyboard.TargetName="backgroundEllipse"
                                            Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)">
                                            <SplineColorKeyFrame KeyTime="00:00:00.2" Value="#00000000"/>
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames  
                                            AutoReverse="False" Duration="00:00:00.2"
                                            Storyboard.TargetName="ButtonPath"
                                            Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)">
                                            <SplineColorKeyFrame KeyTime="00:00:00.2" Value="#FF8f949b"/>
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames  
                                            AutoReverse="False" Duration="00:00:00.2"
                                            Storyboard.TargetName="backgroundEllipse"
                                            Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)">
                                            <SplineColorKeyFrame KeyTime="00:00:00.2" Value="#FFc13535"/>
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames  
                                            AutoReverse="False" Duration="00:00:00.2"
                                            Storyboard.TargetName="ButtonPath"
                                            Storyboard.TargetProperty="(Path.Stroke).(SolidColorBrush.Color)">
                                            <SplineColorKeyFrame KeyTime="00:00:00.2" Value="#FFf9ebeb"/>
                                        </ColorAnimationUsingKeyFrames>
                                     </Storyboard>
                                </VisualState>

                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>